package week6;

public class BankAccount {
    private int accountnumber;
    private String password;
    private double balance;
    private static double interestRate = 0.02;
    private static double minBalance = 10.0;

    public BankAccount(String password) {
        this.accountnumber = accountnumber++;
        this.password = password;
        this.balance = 0.0;
    }
    public int getAccountnumber() {
        return accountnumber;
    }

    public void setAccountnumber(int accountnumber) {
        this.accountnumber = accountnumber;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public static double getInterestRate() {
        return interestRate;
    }

    public static void setInterestRate(double interestRate) {
        BankAccount.interestRate = interestRate;
    }

    public static double getMinBalance() {
        return minBalance;
    }

    public static void setMinBalance(double minBalance) {
        BankAccount.minBalance = minBalance;
    }

    @Override
    public String toString() {
        return "BankAccount{" +
                "accountnumber=" + accountnumber +
                ", password='" + password + '\'' +
                ", balance=" + balance +
                '}';
    }
}
